import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'home',
    component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
    children:[
      {path:'/index/echarts',name:'echarts',meta:{name:'学生成绩统计分析'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/echarts.vue'),
      },
      {path:'/index/paper',name:'paper',meta:{name:'教师阅卷界面'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/Paper.vue'),
      },
      {path:'/index/taskList',name:'taskList',meta:{name:'教师阅卷主页'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/TaskList.vue'),
      },
      {path:'/index/scores',name:'scores',meta:{name:'学生成绩查询'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/Scores.vue'),
      },
      {path:'/index/teacherMessage',name:'teacherMessage',meta:{name:'教师信息'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/TeacherMessage.vue'),
      },
      {path:'/index/paperMessage',name:'paperMessage',meta:{name:'考试阅卷信息'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/PaperMessage.vue'),
      },
      {path:'/index/createExam',name:'createExam',meta:{name:'新建考试'},
        component: () => import(/* webpackChunkName: "about" */ '../views/manage/CreateExam.vue'),
      },
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue'),

  },
  {
    path: '/',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
